package com.tan.websocket.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tan.common.domain.chat.ChatGroupUser;
import com.tan.common.mapper.chat.ChatGroupUserMapper;
import com.tan.websocket.service.IChatGroupUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Tan-Bowen
 * @description
 * @date 2025/1/28 23:42
 */
@Slf4j
@Service
public class ChatGroupUserServiceImpl extends ServiceImpl<ChatGroupUserMapper, ChatGroupUser> implements IChatGroupUserService {

    @Override
    public List<ChatGroupUser> groupUsers(Long groupId) {
        LambdaQueryWrapper<ChatGroupUser> wrapper = Wrappers.lambdaQuery(ChatGroupUser.class)
                .eq(ChatGroupUser::getGroupId, groupId);
        return this.baseMapper.selectList(wrapper);
    }
}
